class Solution:

    def splitNum(self, num: int) -> int:
        a = sorted(map(int, str(num)))
        x = y = 0
        for i, v in enumerate(a):
            if i & 1 == 0:
                x = x * 10 + v
            else:
                y = y * 10 + v
        return x + y


s = Solution()
print(s.splitNum(4325))
print(s.splitNum(687))


class Solution:

    def splitNum(self, num: int) -> int:
        a = "".join(sorted(str(num)))
        return int(a[::2]) + int(a[1::2])


s = Solution()
print(s.splitNum(4325))
print(s.splitNum(687))


print(sorted(str(123)))